package example;

public class StringDemo {
	public static void main(String[] args) {
		String string="this is string %s %d";
		
		String name="my name is liu";
		int age=21;
		String s1="this is a double %f";
		Double double1=12.11;
		String s2="this is a float number %f";
		Float float1=(float) 11.2;
		String s3="this is a long %d";
		Long long1= (long) 23;
		System.out.println(String.format(s3, long1));
		
		System.out.println(String.format(s2, float1));
		System.out.println(String.format(string, name,age));
		//System.out.println(String.format(string, name));
		System.out.println(String.format(s1, double1));
	}

}
